package com.pureut.quality.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pureut.quality.domain.QualityInspectionDocument;
import com.pureut.quality.domain.dto.BadMonthDto;
import com.pureut.quality.domain.dto.QualityInspectionDocumentDto;
import com.pureut.quality.domain.dto.SampleInspectionDto;
import com.pureut.quality.domain.dto.YieldDto;
import com.pureut.quality.domain.vo.*;
import com.pureut.system.api.vo.ReturnStatusVo;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/***
 * 检验单据service
 * Author:C
 * Date:2023/02/06 10:28
 * @DESC
 */
public interface QualityInspectionDocumentService extends IService<QualityInspectionDocument> {

    /**
     * 检验单据列表
     */
    List<QualityInspectionDocumentDto> getDocumentList(QualityInspectionDocumentVo qualityInspectionDocumentVo);

    /**
     * 检验单据新增
     */
    boolean add(QualityInspectionDocumentVo qualityInspectionDocumentVo) throws Exception;

    /**
     * 检验单据新增(脱脂模块使用)
     *
     * @param qualityInspectionDocumentVo
     * @return
     * @throws Exception
     */
    boolean addDegreas(QualityInspectionDocumentVo qualityInspectionDocumentVo) throws Exception;

    /**
     * 检验单据新增(仓库模块使用)
     *
     * @param qualityInspectionDocumentVo
     * @return
     * @throws Exception
     */
    boolean addWares(QualityInspectionDocumentVo qualityInspectionDocumentVo) throws Exception;

    /**
     * 单据信息查看
     */
    QualityInspectionDocumentDto getView(Long id);

    /**
     * 样品检验(检验项目列表)
     */
    List<SampleInspectionDto> sampleInspection(QualitySchemeConfigurationVo qualitySchemeConfigurationVo);

    /**
     * 来料处理
     */
    boolean processingIncomingMaterials(ProcessingIncomingMaterialsVo processingIncomingMaterialsVo);

    /**
     * 品质处理
     */
    boolean qualityTreatment(ProcessingIncomingMaterialsVo processingIncomingMaterialsVo) throws Exception;

    /**
     * 批量审核
     */
    boolean batchAudit(OrderBatchReviewVo orderBatchReviewVo) throws Exception;

    /**
     * 各模块回传检验状态
     */
    boolean returnStatus(ReturnStatusVo returnStatusVo) throws Exception;

    /**
     * 各模块回传检验状态(品质处理时候调用)
     */
    boolean returnQualityStatus(ReturnStatusVo returnStatusVo) throws Exception;

    /**
     * 删除检验单配置
     *
     * @param relevanceDoc
     * @return
     */
    boolean removeDoc(String relevanceDoc);

    /**
     * 生产看板-近7天良品率
     *
     * @param lineCode
     * @return
     */
    YieldDto getYield(String lineCode);

    /**
     * 生产看板-本月品质不良分布
     *
     * @param lineCode
     * @return
     */
    List<BadMonthDto> getBadMonth(String lineCode);

    /**
     * 根据批次号查询品质检验单(fegin调用)
     */
    QualityInspectionDocumentDto getDocumentByBatchNumber(String batchNumber, String degreasDocumentNumber);

    /**
     * 修改品质检验单数据状态（fegin调用）
     */
    boolean updateQualityInspectionDocument(UpdateQualityStatusVo updateQualityStatusVo);

//    /**
//     * 导出单据
//     */
//    void productionPickingExport(HttpServletResponse response, ProductionPickingExportVo productionPickingExportVo) throws IOException;
}
